//
//  ChartPieItem.swift
//  KoiAccounting
//
//  Created by 纪洪文 on 06.04.25.
//

import Foundation
import SwiftUI

struct ChartPieItem {
    // 类别
    var category: AccountingCategory
    // 类别汇总金额
    var amount: Double
    // 类别汇总百分比
    var percent:Double
    // 饼图颜色
    var color: Color
    
    func getNameAndPercent() -> String {
        return "\(category.name.orEmpty) \(percent.toPercent())"
    }
}
